Skip to content

refactor: drop unused abc.ABC from BaseInstrument; document config holders#100

Merged
lesnik512 merged 1 commit into
mainfrom
refactor/ref-3-5-base-layer
Jun 1, 2026
Merged

refactor: drop unused abc.ABC from BaseInstrument; document config holders#100
lesnik512 merged 1 commit into
mainfrom
refactor/ref-3-5-base-layer

Conversation

@lesnik512

@lesnik512 lesnik512 commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

Two small base-layer cleanups:

  • REF-3: BaseInstrument inherited from abc.ABC but defined no abstract methods. After PR7 made the class generic and removed the # noqa: B027 suppressions, abc.ABC served no purpose — all four methods (bootstrap, teardown, is_ready, check_dependencies) are concrete no-ops with sensible defaults. Drop the abc.ABC parent and the now-unused import abc. BaseBootstrapper still uses abc.ABC (it has real abstract methods: not_ready_message, _prepare_application, is_ready) and is intentionally unchanged.
  • REF-5: Added one-line module docstrings to swagger_instrument.py and prometheus_instrument.py explaining that these files hold config and minimal base logic; framework-specific bootstrap behavior lives in the bootstrapper subclasses. Kept as separate modules per the locked decision in the deferred-refactors sequencing spec.

No behavior change. 5 insertions / 2 deletions.

Closes REF-3 and REF-5 from an internal audit.

Test plan

  • just test — 128/128.
  • just lint — clean.
  • Reviewer: confirm no isinstance(..., abc.ABC) check anywhere in the codebase relies on BaseInstrument's former ABC parent.

🤖 Generated with Claude Code

…lders

REF-3: BaseInstrument inherited from abc.ABC but defined no abstract
methods. After PR7 made the class generic and removed the # noqa: B027
suppressions, abc.ABC serves no purpose — all four methods
(bootstrap, teardown, is_ready, check_dependencies) are concrete
no-ops with sensible defaults. Drop the abc.ABC parent and the now-
unused `import abc`.

BaseBootstrapper still uses abc.ABC (it has real abstract methods:
not_ready_message, _prepare_application, is_ready) and is unchanged.

REF-5: Add one-line module docstrings to swagger_instrument.py and
prometheus_instrument.py explaining that these files hold config and
minimal base logic; framework-specific bootstrap behavior lives in
the bootstrapper subclasses (FastAPISwaggerInstrument, etc.). These
files were left as separate modules per the locked decision in the
deferred-refactors sequencing spec.

No behavior change.

Closes REF-3 and REF-5 from the audit.
@lesnik512 lesnik512 self-assigned this Jun 1, 2026
@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
lite_bootstrap/instruments/base.py 100.00% <100.00%> (ø)
...ite_bootstrap/instruments/prometheus_instrument.py 100.00% <ø> (ø)
lite_bootstrap/instruments/swagger_instrument.py 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lesnik512 lesnik512 merged commit a6c3d32 into main Jun 1, 2026
8 checks passed
@lesnik512 lesnik512 deleted the refactor/ref-3-5-base-layer branch June 1, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant